<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var pi = Math.PI;
console.log(Math.PI);
console.log(Math.E);
console.log(Math.max(10, 20, 3, 6,8));
console.log(Math.min(10, 20, 3, 6,8));

var arr = [10, 30, 10, 3, 8];
console.log(Math.max(...arr));
console.log(Math.max.apply(Math, arr));  // 函数借调

console.log(Math.floor(3.999));  // 返回小于等于参数的最大整数
console.log(Math.ceil(-3.5));
console.log(Math.round(-3.6888));
console.log(Math.pow(2, 8));  //
//console.log(2**8);
console.log(Math.sqrt(3));
console.log(Math.pow(3, 1 / 3));

console.log(Math.sin(toRadian(30)));


function toRadian(degree){
    return Math.PI / 180 * degree
}
function toDegree(radian){
   return 180 / Math.PI * radian
}

console.log(Math.hypot(6, 8));  // sqrt(3^2 + 4^ 2)
console.log(Math.trunc(3.305804385093480534));
</script>
</body>
</html>
<!--
    作者：李振超  2017年7月27日08:31
    
-->